﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="ClipList.ascx.cs"
    Inherits="NCS.Module.Multimedia.Admin.Video.ClipList" %>
<%@ Register Assembly="NCS.Library" Namespace="NCS.Library.Controls"
    TagPrefix="cc1" %>
<%@ Register Assembly="NCS.FilePickerControl" Namespace="NCS.FilePicker"
    TagPrefix="cc2" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
        
<asp:UpdatePanel ID="uppanelDistribution" runat="server" UpdateMode="Conditional"
    RenderMode="Inline">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="dropalbum" EventName="SelectedIndexChanged" />
    </Triggers>
    <ContentTemplate>
     <asp:HiddenField ID="hddID" runat="server" />
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    Thuộc Album &nbsp;&nbsp;</td>
                <td>
                    <asp:DropDownList ID="dropalbum" DataTextField="AlbumName" DataValueField="AlbumID"
                        Width="352px" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 750px;" colspan="2">
                    <cc1:GridView ID="dtgPicList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" CellPadding="2"
                        CssClass="Grid" PageSize="15" Width="100%" OnRowCommand="dtgPicList_RowCommand"
                        OnRowDataBound="dtgPicList_RowDataBound" OnRowEditing="dtgPicList_RowEditing" OnRowDeleting="dtgPicList_RowDeleting">
                        <AlternatingRowStyle CssClass="Grid_Raw2" />
                        <RowStyle CssClass="Grid_Raw1" />
                        <HeaderStyle Font-Bold="True" CssClass="Grid_Top"></HeaderStyle>
                        <Columns>
                            <asp:BoundField Visible="true" DataField="ClipID" HeaderText="ID">
                                <headerstyle width="0%"></headerstyle>
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Ảnh đại diện">
                                <headerstyle horizontalalign="Center"></headerstyle>
                                <itemstyle horizontalalign="Center" />
                                <itemtemplate>
									<img src='<%# NCS.Library.Utilities.MultimediaUtility.GetGalleryAvatar(Eval("ClipAvatar").ToString()) %>' alt='<%# Eval("ClipName") %>' width="75" border="0" />
								</itemtemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Ngày tạo" DataField="CreateDate" />
                            <asp:TemplateField>
                                <headerstyle horizontalalign="Center" width="70px"></headerstyle>
                                <itemstyle horizontalalign="Center"></itemstyle>
                                <headertemplate>
									<asp:Button ID="cmdUpdateIndex" CausesValidation="false" runat="server" Width="60" CommandName="updatepriority"
										CssClass="Button" Text="Thứ tự"></asp:Button>
								</headertemplate>
                                <itemtemplate>
									<asp:DropDownList ID="dropIndex" runat="server" Width="60">
									</asp:DropDownList>
								</itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Thao t&#225;c">
                                <headerstyle horizontalalign="Center" width="150px"></headerstyle>
                                <itemstyle horizontalalign="Center"></itemstyle>
                                <itemtemplate>									
									<asp:Button ID="cmdEdit" CausesValidation="false" runat="server" CssClass="Button" CommandName="edit"
										Text="Sửa" CommandArgument='<%# Eval("ClipID") %>'></asp:Button>
									<asp:Button ID="cmdDel" CausesValidation="false" runat="server" CssClass="Button" CommandName="delete"
										Text="Xóa" CommandArgument='<%# Eval("ClipID") %>' OnClientClick="return confirm('Bạn có chắc chắn?');"></asp:Button>									
								</itemtemplate>
                            </asp:TemplateField>
                        </Columns>
                    </cc1:GridView>
                </td>
            </tr>
        </table>
        <table border="0" cellpadding="3" cellspacing="3">
            <tr>
                <td>
                    <br />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Label ID="lbupdate" runat="server" Font-Bold="true" ForeColor="Blue"></asp:Label></td>
            </tr>
            
            <tr>
                <td>
                    Mô tả clip
                </td>
                <td>
                    <asp:TextBox ID="txtPicName" MaxLength="250" Width="500px" runat="server"></asp:TextBox>                                        
                </td>
            </tr>
            <tr>
                <td>
                    Ảnh đại diện
                </td>
                <td>
                    <cc2:FilePicker ID="txtAvatar" runat="server" onkeypress="return false;" MaxLength="250" Width="500px" fpPopupURL="/FilePicker/TUFilePicker.aspx"></cc2:FilePicker>
                </td>
            </tr>
            <tr>
                <td>Clip</td>
                <td>
                    <cc2:FilePicker ID="txtClip" runat="server" onkeypress="return false;" MaxLength="250" Width="500px" fpPopupURL="/FilePicker/TUFilePicker.aspx"></cc2:FilePicker>
                </td>
            </tr>
            <tr>
                <td>
                    Mô tả bổ xung</td>
                <td>
                    <asp:TextBox ID="txtDetail" runat="server" Width="500px" TextMode="multiLine" Rows="10"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="height:5px;" colspan="2">
                </td>
                
            </tr>
            <tr>
            <td></td>
                <td>
                    <asp:CheckBox ID="chkpic" runat="server" Text="Hiển thị" /></td>
            </tr>
            <tr>
                <td style="height:5px;" colspan="2">
                </td>
                
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnAdd" runat="server" CssClass="Button" Text="Thêm mới" OnClick="btnAdd_Click" />
                    <asp:Button ID="btnUpdate" runat="server" CssClass="Button" Text="Cập nhật" OnClick="btnUpdate_Click" />
                    <asp:Button ID="btnCancel" runat="server" CssClass="Button" Text="Hủy" OnClick="btnCancel_Click" />
                </td>
            </tr>            
        </table>

   </ContentTemplate>
</asp:UpdatePanel>